package com.kw.model.weixin.user.entry;

import java.util.HashMap;


public class WeiXinUserType implements WeiXinUserTypeInterface {
	
	private HashMap<Integer,Integer[]> permission=new HashMap<Integer,Integer[]>();
	
	public WeiXinUserType(){	
		permission.put(0,new Integer[]{0});
	}
	
	public void setUserAccess(int userTypeId,Integer[] commands){
		permission.put(userTypeId, commands);
	}
	
	public boolean access(int userTypeId,int commandId){
		Integer[] commands=permission.get(userTypeId);
		if(permission==null){
			return false;
		}else{
			for(Integer command:commands){
				if(command==commandId){
					return true;
				}
			}
			return false;
		}
	}	

}
